////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//  Filename:    ZombiesVsCheerleadGuts.h			                          //
//  Developer:				                                                  //
//  Create date:			                                                  //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//  Description: This is the class declaration for the slot gut of the        //
//               Australian Slot machine called Zombies Vs Cheerleaders       //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////
//        2011 - Riplife Gaming.  All rights reserved.						  //
////////////////////////////////////////////////////////////////////////////////

#if !defined(__ZOMBIESVSCHEERLEADSGUTS_H__)
#define __ZOMBIESVSCHEERLEADSGUTS_H__

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "slotguts.h"
#include "getrand.h"

class ZombiesVsCheerleadGuts : public SlotGuts
{
public:
	ZombiesVsCheerleadGuts();

	virtual ~ZombiesVsCheerleadGuts();

private:
	// Shared enums between client and server
	#include "ZombiesVsCheerleadCommon.h"

	// Helpful lookup arrays.
	static SpinResult m_aLineWinSpinResults[][6];
	static SpinResult m_aScatterWinSpinResults[][6];

	// Inline functions to use with the arrays that also do
	// bounds checking.
	static SpinResult lookupLineWinSpinResult( uint8 nIconType, uint8 nCount )
	{
		if ( nIconType < NUM_VALID_ICONS && nCount < 6 )
		{
			return m_aLineWinSpinResults[ nIconType ][ nCount ];
		}

		ASSERT( false );
		return EVT_INVALID;
	}

	static SpinResult lookupScatterWinSpinResult( uint8 nIconType, uint8 nCount )
	{
		if ( nIconType < NUM_VALID_ICONS && nCount < 6 )
		{
			return m_aScatterWinSpinResults[ nIconType ][ nCount ];
		}

		ASSERT( false );
		return EVT_INVALID;
	}

	void tryForJackpot( SlotSpin* spin );

	SpinResult getScatterWinResult( SlotSpin* spin, uint8 testIcon, int32& scatterPositions ) const;
	
	void evaluateScatterWin( SlotSpin* spin, SpinResult srScatterResult, int32 scatterPositions );


protected:
	//virtual int32 getNumLinesBet();

public:
	
	SpinResult getWildsWinResult( uint8* stops, bool8 RightToLeft );

    SpinResult getLineWinResultWithPossibleSubstitution( uint8* stops, uint8 testIcon, bool8 RightToLeft, bool8& wildSubstitution );
			   
		/**
         * @brief Iterate the lines played and determine winners.
         * @param spin the slot spin.
         * @see classifyStops
         */
	void classifyZombiesVsCheerleadStops( uint8* stops, bool8 RightToLeft, uint8& rtnresult, bool8& wildSubstitution );

	bool doesWildLineWinPayMore( SpinResult srWilds, SpinResult srOther, bool8 wildSubstitution  ) const;

    virtual void classifyResult(SlotSpin *spin);

	SpinResult classifyZombiesVsCheerleadScatters( SlotSpin *spin );

    virtual bool8 isValidGuts();

    virtual void getGameModeMultiplierAndNoteId( uint8& nGameModeMultiplier, uint8& nNoteId );



protected:
	// Override these framework functions.
	virtual void preSpinClassifyResults( SlotSpin* spin );
    virtual void postSpinClassifyResults( SlotSpin* spin );

	virtual bool8 hasSavedGames();

	virtual void Debug_SetLoserStops( uint8* pStops );

	int32 getProgressiveValue();

	virtual void initDebugFunctionMap();

};  


#endif // !defined(__ZombiesVsCheerleadGuts_H__)
